package com.cqhilink.iot.jobstandardmanagement.facade.utils;

/**
 * Created by huangxueqian@cqhilink.com on 2016/12/9.
 * 复杂程度，复杂程度修改成，高中低枚举值
 */
public enum OpCycleType {
    OpCycleType_1(1,"固定周期"),
    OpCycleType_2(2,"自定义周期"),
    OpCycleType_3(3,"无固定周期"),
    ;
    /** 编码 */
    private int code;
    /** 描述 */
    private String description;

    OpCycleType(int code, String description){
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static String getDescription(int code) {
        for (OpCycleType ce : OpCycleType.values()) {
            if (ce.getCode() == code) {
                return ce.getDescription();
            }
        }
        return null;
    }
}
